/** 
* @description:	日历国际化文件
* @author:	yanxiaoe 
*/
define(['jquery', 'timepicker-addon'], function($) {
	$.datepicker.regional['zh']  = {
		currentText: '当前',
		closeText: '确定',
		timeText: '时间',
		hourText: '时',
		minuteText: '分',
		secondText: '秒',
		monthNames: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
		dayNamesMin: ['七', '一', '二', '三', '四', '五', '六'],
		showMonthAfterYear: true,
		yearSuffix: '年'
	};
	$.datepicker.setDefaults($.datepicker.regional['zh']);
	$.timepicker.setDefaults($.datepicker.regional['zh']);
	$.timepicker.xomsControl = {
		create: function(tp_inst, obj, unit, val, min, max, step){
			$('<input class="ui-timepicker-input" value="'+val+'" style="width:100%">')
				.appendTo(obj)
				.spinner({
					min: min,
					max: max,
					step: step,
					change: function(e,ui){ // key events
							// don't call if api was used and not key press
							if(e.originalEvent !== undefined)
								tp_inst._onTimeChange();
							tp_inst._onSelectHandler();
						},
					spin: function(e,ui){ // spin events
							tp_inst.control.value(tp_inst, obj, unit, ui.value);
							tp_inst._onTimeChange();
							tp_inst._onSelectHandler();
						}
				});
			return obj;
		},
		options: function(tp_inst, obj, unit, opts, val){
			if(typeof(opts) == 'string' && val !== undefined)
				return obj.find('.ui-timepicker-input').spinner(opts, val);
			return obj.find('.ui-timepicker-input').spinner(opts);
		},
		value: function(tp_inst, obj, unit, val){
			if(val !== undefined)
				return obj.find('.ui-timepicker-input').val(val);
			return obj.find('.ui-timepicker-input').spinner('value');
		}
	};
	return $.timepicker;
});